package com.hackerrank.contests.oct13.challenges.pseudoisomorphicsubstrings;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Solution {
	private static class N {
		int n;
		N[] b = new N[26];
		public N(int n) {
			this.n = n;
		}
		public boolean add(int sn) {
			if(b[sn] != null)
				return false;
			b[sn] = new N(sn);
			return true;
		}
		public String toString() {
			StringBuilder s = new StringBuilder("{").append(n);
			for(int i = 0; i < b.length; i++)
				if(b[i] != null)
					s.append(", ").append(b[i]);
			s.append("}");
			return s.toString();
		}
	}
	private static class P {
		N n;
		int a = 0, m[] = new int[26];
		public P(N n) {
			this.n = n;
			for(int i = 0; i < 26; i++)
				m[i] = -1;
		}
		public int associate(char c) {
			if(m[c - 'a'] < 0)
				m[c - 'a'] = a++;
			return m[c - 'a'];
		}
	}
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		char s[] = in.nextLine().toCharArray();
		List<P> l = new ArrayList<P>();
		N r = new N(0);
		int c = 1;
		for(int i = 0; i < s.length; i++) {
			for(int j = 0; j < l.size(); j++) {
				P p = l.get(j);
				int a = p.associate(s[i]);
				if(p.n.add(a))
					c++;
				p.n = p.n.b[a];
			}
			P p = new P(r);
			p.associate(s[i]);
			l.add(p);
			System.out.println(c);
		}
	}
}
